package cn.wei.reallyEnjoy.app;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;

import cn.wei.reallyEnjoy.R;

public class startActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //隐藏顶部的状态栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_start);
        //去掉窗口标题
        getSupportActionBar().hide();

        //设置启动页
        //在startActivity停留2秒然后进入MainActivity
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                //执行在主线程
                //启动主页面
                startActivity(new Intent(startActivity.this, MainActivity.class));
                //关闭当前页面
                finish();
            }
        },2000);
    }
}